import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { SharedModule } from '@shared/shared.module';

import { ProjectComponent } from './project.component';
import { ProListComponent } from './pro-list/pro-list.component';
import { ProcessComponent } from './process/process.component';
import { SceneModule } from './scene/scene.module';
import { AddProjectComponent } from './pro-list/add-project/add-project.component';
import { MapComponent } from './pro-list/map/map.component';
import { FlowComponent } from './pro-list/flow/flow.component';
import { ProcesComponent } from "./pro-list/flow/proces/proces.component";
import { DebateComponent } from "./pro-list/flow/debate/debate.component";
import { RoleComponent } from "./pro-list/flow/role/role.component";
import { AdvanceComponent } from './pro-list/advance/advance.component';
import { ViewcrouseComponent } from './pro-list/viewcrouse/viewcrouse.component';

const routes: Routes = [
    {
        path: 'full', component: ProjectComponent,
        children: [
            { path: '', redirectTo: 'pro-list/cloud', pathMatch: 'full' },
            { path: 'scene', loadChildren: './scene/scene.module#SceneModule' },
            { path: 'pro-list/:ident', component: ProListComponent },
            { path: 'process', component: ProcessComponent },
            { path: 'add-project/:type/:id', component: AddProjectComponent },
            {
                path: 'flows',
                component: FlowComponent,
                children: [
                    { path: 'proces', component: ProcesComponent },
                    { path: 'debate', component: DebateComponent },
                    { path: 'role', component: RoleComponent }
                ]
            },
            { path: 'map', component: MapComponent },
            { path: 'advance', component: AdvanceComponent },
            { path: 'viewcrouse', component: ViewcrouseComponent },
        ]
    },
    {
        path: '', redirectTo: './full', pathMatch: 'full'
    }
];

@NgModule({
    imports: [
        SharedModule,
        RouterModule.forChild(routes),
        SceneModule
    ],
    declarations: [
        ProjectComponent,
        ProListComponent,
        ProcessComponent,
        AddProjectComponent,
        MapComponent,
        FlowComponent,
        ProcesComponent,
        DebateComponent,
        RoleComponent,
        AdvanceComponent,
        ViewcrouseComponent
    ],
    exports: [
        RouterModule
    ],
    entryComponents: [

    ]
})
export class ProjectModule { }
